翻訳と辞書
Words near each other
・ Candidates of the Queensland state election, 1944
・ Candidates of the Queensland state election, 1947
・ Candidates of the Queensland state election, 1950
・ Candidates of the Queensland state election, 1953
・ Candidates of the Queensland state election, 1956
・ Candidates of the Queensland state election, 1957
・ Candidates of the Queensland state election, 1960
・ Candidates of the Queensland state election, 1963
・ Candidates of the Queensland state election, 1986
・ Candidates of the Queensland state election, 1989
・ Candidates of the Queensland state election, 1992
・ Candidates of the Queensland state election, 1995
・ Candidate division
・ Candidate division TM7
・ Candidate gene
Candidate key
・ Candidate move
・ Candidate of Law
・ Candidate of Medicine
・ Candidate of Philosophy
・ Candidate of Sciences
・ Candidate selection procedure in the United States and the European Union
・ Candidate solution
・ Candidate submittal
・ Candidates in the Cook Islands general election 2010 by electorate
・ Candidates in the New Zealand general election 2005 by electorate
・ Candidates in the New Zealand general election 2005 by party
・ Candidates in the New Zealand general election 2008 by electorate
・ Candidates in the New Zealand general election 2011 by electorate
・ Candidates in the New Zealand general election 2014 by electorate


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Candidate key : ウィキペディア英語版
Candidate key
In the relational model of databases, a candidate key of a relation is a minimal superkey for that relation; that is, a set of attributes such that:
# the relation does not have two distinct tuples (i.e. rows or records in common database language) with the same values for these attributes (which means that the set of attributes is a superkey)
# there is no proper subset of these attributes for which (1) holds (which means that the set is minimal).
The constituent attributes are called prime attributes. Conversely, an attribute that does not occur in ANY candidate key is called a non-prime attribute.
Since a relation contains no duplicate tuples, the set of all its attributes is a superkey if NULL values are not used. It follows that every relation will have at least one candidate key.
The candidate keys of a relation tell us all the possible ways we can identify its tuples. As such they are an important concept for the design of database schema.
==Example==
The definition of candidate keys can be illustrated with the following (abstract) example. Consider a relation variable (relvar) ''R'' with attributes (''A'', ''B'', ''C'', ''D'') that has only the following two legal values ''r1'' and ''r2'':
Here ''r2'' differs from ''r1'' only in the A and D values of the last tuple.
For ''r1'' the following sets have the uniqueness property, i.e., there are no two distinct tuples in the instance with the same values for the attributes in the set:
: , , , , , , ,
For ''r2'' the uniqueness property holds for the following sets;
: , , , , , , ,
Since superkeys of a relvar are those sets of attributes that have the uniqueness property for ''all'' legal values of that relvar and because we assume that ''r1'' and ''r2'' are all the legal values that ''R'' can take, we can determine the set of superkeys of ''R'' by taking the intersection of the two lists:
: , , , , ,
Finally we need to select those sets for which there is no proper subset in the list, which are in this case:
: , ,
These are indeed the candidate keys of relvar ''R''.
We have to consider ''all'' the relations that might be assigned to a relvar to determine whether a certain set of attributes is a candidate key. For example, if we had considered only ''r1'' then we would have concluded that is a candidate key, which is incorrect. However, we ''might'' be able to conclude from such a relation that a certain set is ''not'' a candidate key, because that set does not have the uniqueness property (example for ''r1''). Note that the existence of a proper subset of a set that has the uniqueness property ''cannot'' in general be used as evidence that the superset is not a candidate key. In particular, note that in the case of an empty relation, every subset of the heading has the uniqueness property, including the empty set.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Candidate key」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.